#pragma once
#include "JeayeSDK.h"

#define C_AES_MAXNR 14
#define C_AES_BLOCK_SIZE 16

#define C_AES_ENCRYPT    1
#define C_AES_DECRYPT    0
#define C_AES_BUFFER_LEN(l) ((l + (C_AES_BLOCK_SIZE - 1)) / C_AES_BLOCK_SIZE) * C_AES_BLOCK_SIZE

typedef struct _aes_key_t {
	UINT32 round_key[4 * (C_AES_MAXNR + 1)];
	INT32 rounds;
}c_aes_key_t;

/******************************************
******************************************/
JEAYESDK_API INT32 c_aes_encrypt_key(const BYTE*, const INT32, c_aes_key_t*);
JEAYESDK_API INT32 c_aes_decrypt_key(const BYTE*, const INT32, c_aes_key_t*);
/******************************************
******************************************/
JEAYESDK_API void c_aes_encrypt(const BYTE*, BYTE*, const c_aes_key_t*);
JEAYESDK_API void c_aes_decrypt(const BYTE*, BYTE*, const c_aes_key_t*);
